3.4 How to transit to another web page/application?

  1. Which element can be used to transit to another web page/application?
    • <a>
    • <form>
    • <iframe>
      • Read all in HTML Iframes.
        • For what do you use iframes?
        • Study carefully 'Iframe - Target for a Link' in the above web page.
      • Study carefully all in Post Data to an iframe. We will discuss about it later in more detail.
        • Iframe - target for a <form>
    • How can you display a linked page into an iframe in the same window?
      The target attribute with the value of the name of an iframe
    • How can you display the result from a form into an iframe in the same window?
      The target attribute with the value of the name of an iframe
    • Note that the attribute, id, is usually used to access HTML elements from JS codes. The attribute, name, is usually used to connect HTML elements from other elements.
    • Trial 1. Let's try to display cs.tru.ca/~mlee/comp3540 in an iframe.


    • The proper URL for cs.tru.ca in the above example? [[protocol:]//domain_name_or_IP_address[:port_number]/]path_of_resource
      You may see What is a URL?.
  2. [Can you use JavaScript to transit to another web page/application?]

  3. Learning outcomes
    • How to transit to another web page/application using HTML elements and JavaScript code.